<template>
  <div class="release">
    <ding-bu :name="nameone"></ding-bu>
    <van-cell-group class="biaoti">
      <van-field v-model="value" placeholder="请输入标题" />
    </van-cell-group>
    <van-field
      v-model="message"
      rows="2"
      autosize
      type="textarea"
      maxlength="50"
      placeholder="请输入内容"
      show-word-limit
    />
    <van-uploader :after-read="afterRead"  />
    <div class="Btn-fabu">确定</div>

    <Menu></Menu>
  </div>
</template>

<script>
import DingBu from "../components/dingbu.vue";
import Menu from "../components/menu.vue";
import { Uploader } from "vant";
export default {
  components: {
    Menu,
    DingBu,
    [Uploader.name]: Uploader,
  },
  data() {
    return {
      value: "",
      message: "",
      nameone: "发布",
    };
  },
  methods: {
    afterRead(file) {
      // 此时可以自行将文件上传至服务器
      console.log(file);
    },
  },
};
</script>

<style>
.release {
  background-color: rgba(166, 168, 170, 0.187);
  height: 100vh;
}
.Release-fabo {
  display: flex;
  justify-content: center;
  color: white;
  line-height: 50px;
  text-align: center;
  width: 100%;
  height: 50px;
  background: rgb(7, 193, 96);
}
.biaoti {
  margin: 10px 0px;
}
.Release-tu img {
  margin-top: 30px;
  margin-left: 30px;
  width: 30px;
}
.Btn-fabu {
  margin: 20px auto;
  color: white;
  line-height: 50px;
  text-align: center;
  width: 80%;
  height: 50px;
  background: rgb(7, 193, 96);
}
</style>